package com.woniu.command.handle;

import com.woniu.adapter.ScheWorkAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ScheWorkCommandHandle {

    @Autowired
    private ScheWorkAdapter scheWorkAdapter;

    //为生产排程添加工序
    public String addScheWork(Long proScheId,String workProCode){
        try {
            scheWorkAdapter.addWorking(proScheId,workProCode);
            return "添加成功";
        } catch (Exception e) {
            e.printStackTrace();
            return "添加失败"+e.getMessage();
        }
    }

    //为生产排程删除工序
    public String deScheWork(Long proScheId,String workProCode){
        try {
            scheWorkAdapter.deleteWorking(proScheId,workProCode);
            return "删除成功";
        } catch (Exception e) {
            e.printStackTrace();
            return "删除失败"+e.getMessage();
        }
    }
}
